﻿using System;
using System.Collections.Generic;
using Assets.Scripts.Net.Data.Model;

namespace Assets.Scripts.Net.Data.Reader
{
    public class StudyInfoReader:NetInfoReaderBase
    {
        public StudyInfoReader(List<object> list, Action<Dictionary<string, string>> action) : base(list, action)
        {
            if(list==null)return;
            List<StudyInfo> infos = new List<StudyInfo>();
            for (int i = 0; i < list.Count; i++)
            {
                StudyInfo info = new StudyInfo();
                Dictionary<string, object> dict = list[i] as Dictionary<string, object>;
                AutoSetValue<StudyInfo>(dict, info);
                infos.Add(info);
            }
            AddInfoToFactory<List<StudyInfo>>(infos);
        }
    }
}